package com.zyz.E_面向对象.I_继承.supper关键字;

/**
 * @author: vick
 * @Date: 2025/3/16
 * @Description:
 * @version: 1.0
 */
public class Student extends Person{
    private int id;

    public Student() {
        //隐藏了一个关键字
        super();
        System.out.println("子类的无参");
    }

    public Student(String name, String age, int id) {
        super(name, age);
        System.out.println("子类的有参");
        this.id = id;
    }

    @Override
    public void eat() {
        System.out.println("SON 吃饭");
    }


    public void print() {
        this.eat();//当前类的  eat方法

        super.eat();//父类的eat方法
    }
}
